package org.venus.onvif.config;

import org.venus.onvif.entity.MediaServer;
import org.venus.onvif.entity.OnvifHelp;
import org.venus.onvif.entity.Video;

import java.util.HashMap;
import java.util.List;

/**
 * Author      jxx
 * Motto       让世界看到我
 * On          2023/11/2 10:19
 * Version     v1.0
 * Note        TODO
 */
public class Config {

    public static List<Video> videos;
    public static MediaServer mediaServer;
    public static HashMap<String, OnvifHelp> onvifDeviceHashMap = new HashMap<>();

    public static float getPtzStep() {
        float defaultStep = 0.2f;
        try {
            if (mediaServer.ptzStep < 1) {
                mediaServer.ptzStep = 1;
            }
            if (mediaServer.ptzStep > 10) {
                mediaServer.ptzStep = 10;
            }
            return mediaServer.ptzStep / 10f;
        } catch (Exception e) {

        }
        return defaultStep;
    }
}
